package com.gable.exhibition.dao;

import com.gable.exhibition.model.Maintainer;
import com.gable.exhibition.view.MaintainerView;
import com.gable.exhibition.view.ManufacturerView;

import java.util.List;
import java.util.Map;

public interface MaintainerDao {
    int deleteByPrimaryKey(Long maintainerId);

    int insert(Maintainer record);

    int insertSelective(Maintainer record);

    Maintainer selectByPrimaryKey(Long maintainerId);

    int updateByPrimaryKeySelective(Maintainer record);

    int updateByPrimaryKey(Maintainer record);

    /**
     * 获取维修商列表,用于下拉框显示
     * @Create user jacky
     * @Create date 2018/2/6
     * @return
     */
    List<Maintainer> queryMaintainer();

    /**
     * 获取维修商总数，用于分页
     * @param maintainerView
     * @Create date 2019/2/8
     * @Create user jacky
     * @return
     */
    int queryMaintainerCount(MaintainerView maintainerView);
    /**
     * 获取维修商列表
     * @param maintainerView
     * @Create date 2019/2/8
     * @Create user jacky
     * @return
     */
    List<MaintainerView> queryMaintainerList(MaintainerView maintainerView);


    /**
     * 判断维修商编号是否存在
     * @Create user jacky
     * @Create date 2018/2/9
     * @return
     */
    int checkMaintainerNo(MaintainerView maintainerView);

    /**
     * 根据维修商名称查询
     * @Create user jacky
     * @Create date 2018/2/9
     * @return
     */
    Maintainer queryByMaintainerName(Maintainer maintainerView);

    /**
     * 获取维修商详情
     * @param maintainerId
     * @Create user jacky
     * @Create date 2018/2/13
     * @return
     */
    MaintainerView queryMaintainerInfo(Long maintainerId);

    /**
     * 根据厂商id获取该厂家下的所有维修商
     * @param manufacturerId
     * @Create user jacky
     * @Create date 2018/2/26
     * @return
     */
    List<MaintainerView> queryMaintainerListByManuId(Long manufacturerId);

    /**
     * 厂商绑定维修商之间的关系初始化数据
     * @param maintainerView
     * @Create user jacky
     * @Create date 2018/2/28
     * @return
     */
    List<MaintainerView> bindMaintainerInit(MaintainerView maintainerView);

    List<Maintainer> queryMaintainerByName(MaintainerView maintainerView);

    Maintainer checkMaintainer(Maintainer maintainer);


    /**
     * 根据关键字模糊查询维修商，自动补全
     * @param map
     * @Create user jacky
     * @Create date 2018/3/22
     * @return
     */
    List<Maintainer> queryMaintainerByCompletion(Map map);

    List<MaintainerView> queryMaintainers();
}